<template>
  <div class="my-form">
    <div class="left">
      <el-form ref="form" :inline="true" :model="formInline" class="demo-form-inline" label-position="top">
        <el-row>
          <slot />
        </el-row>
      </el-form>
    </div>
    <div class="right">
      <el-button type="primary" @click="onSubmit">搜索</el-button>
      <el-button type="primary" class="resect" @click="onReset">重置</el-button>
    </div>

  </div>
</template>

<script>
export default {
  props: {
    formInline: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {

    }
  },
  methods: {
    onSubmit() {
      // console.log('submit!')
      this.$emit('searchFn')
    },
    onReset() {
      this.$refs.form.resetFields()
      this.$emit('searchFn')
    }
  }
}
</script>

<style lang="scss" scoped>
// @import '@/styles/my-form.scss';
.left{
  width: 78%;
}
.right{
      // position: absolute;
      // right: 0;
      padding-top: 28px;
      .el-button{
        height: 40px;
        border-radius: 20px;
        border: 0;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
        padding-left: 26px;
        padding-right: 26px;
        cursor: pointer;
        outline: 0;
        &:last-child{
          background: #f8f5f5;
          color: #332929;
          margin-left: 20px;
        }
      }
    }
</style>
